package com.ruoyi.system.domain.client;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.system.domain.ERP.CustomerErpDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author GE-LV5
 * @create 2023/3/14 10:34
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("base_customer_supplier")
public class BaseCustomerSupplier implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id")
    @Excel(name = "序号")
    private Long id;

    @ApiModelProperty(value = "客户名称")
    @Excel(name = "客户名称")
    private String name;

    @ApiModelProperty(value = "客户编码")
    @Excel(name = "客户编码")
    private String code;

    @ApiModelProperty(value = "客户描述")
    @Excel(name = "客户描述")
    private String baseDescribe;

    @ApiModelProperty(value = "客户类型 0客户 1供应商")
    @Excel(name = "客户类型")
    private String type;

 /*   @ApiModelProperty(value = "客户类型 0客户 1供应商")
    @Excel(name = "客户类型")
    private String typeName;*/

    @ApiModelProperty(value = "状态 0有效  1无效")
    @Excel(name = "状态")
    private String status;


    /** 创建者 */
    @ApiModelProperty(value = "创建者")
    @Excel(name = "创建者")
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    @Excel(name = "创建时间")
    private Date createTime;

    /** 更新者 */
    @ApiModelProperty(value = "更新者")
    @Excel(name = "更新者")
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    @Excel(name = "更新时间")
    private Date updateTime;

    @Excel(name = "客户分类编码")
    @ApiModelProperty(value = "客户分类编码")
    private String classCode;

    @Excel(name = "地址")
    @ApiModelProperty(value = "地址")
    private String address;

    @Excel(name = "邮箱地址")
    @ApiModelProperty(value = "邮箱地址")
    private String email;

    @Excel(name = "联系人")
    @ApiModelProperty(value = "联系人")
    private String contactName;

    @Excel(name = "联系电话")
    @ApiModelProperty(value = "联系电话")
    private String contactTel;

    private String zlk;

    private String delTag;

    private String supplierId;

    public BaseCustomerSupplier(CustomerErpDTO dto){
        this.name = dto.getCustomerName();
        this.code = dto.getCustomerCode();
        this.baseDescribe = dto.getCustomerAbbName();
        this.type="0";
        this.status="0";
        this.classCode = dto.getClassCode();
        this.address = dto.getAddress();
        this.email = dto.getEmail();
        this.contactName = dto.getContactName();
        this.contactTel = dto.getContactTel();
        this.zlk = dto.getZlk();

    }

}
